<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <link href="..\css\bootstrap.min.css" rel="stylesheet" type="text/css">
  <link href="..\css\material-kit.css" rel="stylesheet" type="text/css">
<link href="..\css\Sparql.css" rel="stylesheet" type="text/css">

<script src="..\js\bootstrap-datepicker.js"></script>
<script src="..\js\bootstrap.min.js"></script>
<script src="..\js\jquery.min.js"></script>
<script src="..\js\material-kit.js"></script>
<script src="..\js\material.min.js"></script>
<script src="..\js\nouislider.min.js"></script>
<script src="..\js\Sparql.js"></script>



<script type="text/javascript">

	var xmlHttpRequest = null;

		function ajaxSubmit(){
		//	window.alert(window.ActiveXObject);
			
			if(window.ActiveXObject){	//是IE浏览器

				xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");

			}else if(window.XMLHttpRequest){	//除IE外的其他浏览器

				xmlHttpRequest = new XMLHttpRequest();
			}

			/*
				使用Ajax准备向服务器端发送一个请求
			*/
			if(null != xmlHttpRequest){	//使用GET方式，			//异步
				var txt = document.getElementById("ta").value;
				
				
			//	xmlHttpRequest.open("GET", "AjaxServlet?num1=" + num1 + "&num2=" + num2, "true");

				xmlHttpRequest.onreadystatechange = ajaxCallBack;	//注册一个回调函数

				//向服务器端发送数据
			//	xmlHttpRequest.send(null);	//get方式设置为null

				//post方式
				xmlHttpRequest.open("POST", "AjaxServlet", "true");
				//使用post方式提交数据，必须加上下面这行代码
				xmlHttpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
				
				xmlHttpRequest.send("ta=" + txt);

			}
		}

		function ajaxCallBack(){

			if(xmlHttpRequest.readyState == 4){

				if(xmlHttpRequest.status == 200){
					var responseText = xmlHttpRequest.responseText;	
					
				//	document.getElementById("content").innerText = responseText;	
					
				
					var json = eval('(' + responseText +')');
					createTable("data",json);
					
					//alert(json[1]);
				
					
				}
			} 
		}

		
	
		</script>




</head>

<body >
 <div >
  <!-- logo -->   
<nav class="navbar navbar-info" role="navigation">
    <img class="logo-container" src="..\img\wust1.png">  
    <img class="logo-container" src="..\img\em.png"> 
	
</nav>
<!-- 下方 -->
<div class="row-fluid"  >
   <!-- 侧栏 -->
   <div class="col-md-1 col-xs-3 col-sm-3 col-lg-3 left-div" id="sidebar">
   <ul class="nav nav-pills nav-stacked">

   <li ><a href="#" onclick="sparqlQuery()">Home</a></li>
   <li class="active"><a href="#" >语义查询</a></li>
   <li ><a href="intro.html">系统介绍</a></li>
</ul>
 </div>
   
<!-- 内容页 -->   
<div id="content" class="col-md-10 col-xs-10 col-sm-10 col-lg-10 content-div" >
 
<div class="panel panel-primary">
   <div class="panel-heading">
      <h3 class="panel-title">请输入查询语句</h3>
   </div>
   <div class="panel-body">
      <textarea class="form-control" placeholder="Here can be your nice text" rows="5" id="ta"></textarea>
   </div>
<div class="btn-div">
  <button type="button" class="btn btn-info" onclick="ajaxSubmit()" id="button_submit">
      提交
   </button>
</div>
 </div>

<div class="panel panel-primary">
   <div class="panel-heading">
      <h3 class="panel-title">查询结果</h3>
   </div>
   <div class="panel-body">
    <div id="data">
    </div>
   </div>
 </div>

</div>
 </div>
</body>